<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new sfTestFunctional(new sfBrowser());

$browser->
  get('/moyen/index')->

  with('request')->begin()->
    isParameter('module', 'moyen')->
    isParameter('action', 'index')->
  end()->

  with('response')->begin()->
    isStatusCode(200)->
    checkElement('body', '!/This is a temporary page/')->
  end()
;

$browser->setHttpHeader('X_REQUESTED_WITH', 'XMLHttpRequest');
$browser->
  info('Changement d\'état du moyen')->
 
  get('moyen/changerEtatMoyen?idmoyen=*&idetat=*')->
  with('response')->begin()->
    checkElement('.etatmoyens contains(\'Echec\'', false)->
    checkElement('.etatmoyens contains(\'enregistrement ...\'', false)->
  reload()->
  end()
;
